const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const Timestamp = Date.now();
const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
    outputDir: "D:/project/web/public/api-doc/web",
    transpileDependencies: true,
    assetsDir: 'static',
    parallel: false,
    lintOnSave: false,
    publicPath: './',
    devServer: {
        //要设置当前访问的ip 否则失效
        // host:"localhost",
        //浏览器自动打开页面
        port: 7102,
        open: false,
        historyApiFallback: true,
        proxy: {
            '/dist': {
                target: 'http://localhost:7101/',
                // 服务器服务地址
                // target: 'http://124.222.94.175:7101/',
                pathRewrite: {
                    '^/dist': ''
                },
                logLevel: 'debug'
            }
        }
    },
    configureWebpack: { // webpack 配置
        output: { // 输出重构  打包编译后的 文件名称  【模块名称.版本号.时间戳】
            filename: `js/[name].${Timestamp}.js`,
            chunkFilename: `js/[name].${Timestamp}.js`
        },
        plugins: [
            new MiniCssExtractPlugin({
                // 修改打包后css文件名
                filename: `css/[name].${Timestamp}.css`,
                chunkFilename: `css/[name].${Timestamp}.css`
            })
        ]
    }
})
